<!DOCTYPE html>
<html  lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>开始使用 layui</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>

<body>

<!-- 你的 HTML 代码 -->
<input type="text" value="获取id的值" id="id">
<script src="../layui/layui.js"></script>

</body>
<script type="text/javascript">
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer
            , form = layui.form;

        layer.msg('Hello World');
        layer.open({
            type: 1,
            content: $('#id')  //这里content是一个普通的String
        })
    });
</script>
</html>
